﻿Imports System.Collections.ObjectModel
Imports System.Drawing

Namespace ViewModel
    Public Class ContextMenuCommandViewModel
        Inherits IconicCommandViewModel

#Region "Constructors"

        ''' <summary>
        ''' This constructor creates a root-menu command.
        ''' </summary>
        ''' <param name="name">The header string which displayed in the context-menu.</param>
        ''' <param name="command">The command binding.</param>
        Public Sub New(ByVal name As String, ByVal icon As Bitmap, ByVal command As ICommand)
            Me.New(name, icon, Nothing, command)
        End Sub

        ''' <summary>
        ''' This constructor creates a sub-menu command.
        ''' </summary>
        ''' <param name="name">The header string which displayed in the context-menu.</param>
        ''' <param name="icon">The icon displayed on the context-menu.</param>
        ''' <param name="parent">The parent-menu.</param>
        ''' <param name="command">The command binding.</param>
        Public Sub New(ByVal name As String, ByVal icon As Bitmap, ByVal parent As ContextMenuCommandViewModel, ByVal command As ICommand)
            MyBase.New(name, icon, command)

            Me._parent = parent
            Me._children = New List(Of ContextMenuCommandViewModel)
        End Sub

#End Region

#Region "Properties"

        Private _parent As ContextMenuCommandViewModel
        Public ReadOnly Property Parent() As ContextMenuCommandViewModel
            Get
                Return _parent
            End Get
        End Property

        Private _children As List(Of ContextMenuCommandViewModel)
        Public ReadOnly Property Children() As List(Of ContextMenuCommandViewModel)
            Get
                Return _children
            End Get
        End Property

#End Region

    End Class
End Namespace
